package com.cskaoyan.javase.oop3._3inner._1member._2exercise;

/**
 * 补全代码，要求show方法能够输出三个num
 *
 * @since 17:43
 * @author wuguidong@cskaoyan.onaliyun.com
 */
public class Demo {
    public static void main(String[] args) {
        new Outer().new Inner().show();
        Outer.Inner oi = new Outer().new Inner();
        oi.show();
    }
}

class Outer {
    public int num = 10;

    class Inner {
        public int num = 20;

        public void show() {
            int num = 30;
            // 就近原则
            System.out.println(num);
            // this指向当前对象，就是自身对象
            System.out.println(this.num);
            // 外围类类名点tis，指向外围类对象
            System.out.println(Outer.this.num);
        }
    }
}